﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Text;

namespace NP.BPMReportPlatform.ElectronicSign
{
    /// <summary>
    /// 电子签实体集
    /// </summary>
    public class ESDto
    {
        public class ESCommonResponseForOne
        {
            /// <summary>
            /// 错误码，
            /// 0-成功，
            /// 其它数字均为失败
            /// </summary>
            public int? ErrCode { get; set; }

            /// <summary>
            /// 错误是否显示
            /// </summary>
            public bool ErrShow { get; set; }

            /// <summary>
            /// 错误是否显示
            /// </summary>
            public string Msg { get; set; }

            /// <summary>
            /// 返回的数据内容
            /// </summary>
            public JObject Data { get; set; }
        }

        public class ESCommonResponseForList
        {
            /// <summary>
            /// 错误码，
            /// 0-成功，
            /// 其它数字均为失败
            /// </summary>
            public int? ErrCode { get; set; }

            /// <summary>
            /// 错误是否显示
            /// </summary>
            public bool ErrShow { get; set; }

            /// <summary>
            /// 错误是否显示
            /// </summary>
            public string Msg { get; set; }

            /// <summary>
            /// 返回的数据内容
            /// </summary>
            public List<JObject> Data { get; set; }
        }

        public class CreateResponse
        {
            /// <summary>
            /// 用户在立邦电子签章系统的id
            /// </summary>
            public string AccountId { get; set; }

            /// <summary>
            /// 用户的唯一标识
            /// </summary>
            public string UniqueId { get; set; }
        }

        /// <summary>
        /// 流程状态改变回调实体，我只拿我想要的
        /// </summary>
        public class ESFlowRequest
        {
            /// <summary>
            /// 该参数标记此次回调类型:
            /// SIGN_FLOW_FINISH；终结状态回调
            /// SIGN_FLOW_UPDATE；过程状态更新
            /// SIGN_FLOW_NOTIFY，签署通知
            /// </summary>
            public string Action { get; set; }

            /// <summary>
            /// 业务码
            /// </summary>
            public string BizNo { get; set; }

            public int FlowId { get; set; }
            /// <summary>
            /// action 为SIGN_FLOW_FINISH时:
            /// 2 为签署完成
            /// 5 为过期作废
            /// 7 为拒签
            /// 8 为作废(作废签署完成)
            /// action 为SIGN_FLOW_UPDATE时：
            /// 2 为签署完成
            /// 3 为冻结
            /// 4 为解冻
            /// 5 为静默签署失败
            /// </summary>
            public int Status { get; set; }
            public string ResultDescription { get; set; }
        }

        public class ESFileResponse
        {
            public List<FileBean> SignDocUrlList { get; set; }
        }

        public class FileBean
        {
            public string DocId { get; set; }
            public string DocFileKey { get; set; }
            public string DinishFileKey { get; set; }
            public string DownloadDocUrl { get; set; }
        }
    }
}
